<template>
  <el-select :class="props.class" popper-class="select_popper">
    <el-option
      v-for="item in items"
      :key="item.dictCode"
      :label="item.dictName"
      :value="item.dictCode"
    />
  </el-select>
</template>
<script setup lang="ts">
import { reactive } from "vue";
import { dictMapCache } from "@/api/dict/index";
import type { DictEntryModel } from "@/api/dict/os-dict-entry/types";

const props = defineProps({
  typeCode: {
    type: String,
    default: "",
  },
  enable: {
    type: Boolean,
    default: true,
  },
  class:{
    type: String,
    default: "!w-[203px]",
  }
});
const items = reactive([] as DictEntryModel[]);

dictMapCache(props.typeCode, props.enable).then((res) => {
  items.push(...res);
});
</script>
<style lang="scss">
.select_popper {
  z-index: 99999 !important;
}
</style>
